<template>
	<view class="m-loading-con" v-show="value"  @touchmove.stop.prevent="() => {}">
		<view v-if="mode == 1" class="spinner">
		  <view class="bounce1"></view>
		  <view class="bounce2"></view>
		  <view class="bounce3"></view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"loading",
		props:{
			value:{
				type:Boolean,
				default:false
			},
			mode:{
				type:Number,
				default:1
			}
		},
		watch:{
			value(val){
				if(val){
					uni.hideTabBar()
				}else{
					uni.showTabBar()
				}
			}
		},
		data() {
			return {
				
			};
		},
		created() {
			uni.hideTabBar()
		}
	}
</script>

<style lang="scss">
	.m-loading-con{
		position: fixed;
		top: 0;
		bottom: 0;
		right: 0;
		left: 0;
		z-index: 999;
		background: #fff;
		display: flex;
		justify-content: center;
		align-items: center;
		image{
			width: 100%;
			height: 1154rpx;
		}
	}
	.spinner {
	  display: flex;
	  justify-content: center;
	  align-items: center;
	}
	 
	.spinner > view {
	  width: 30rpx;
	  height: 30rpx;
	  margin: 0 5rpx;
	  background-color: #fa3534;
	 
	  border-radius: 50%;
	  display: inline-block;
	  -webkit-animation: bouncedelay 1.4s infinite ease-in-out;
	  animation: bouncedelay 1.4s infinite ease-in-out;
	  /* Prevent first frame from flickering when animation starts */
	  -webkit-animation-fill-mode: both;
	  animation-fill-mode: both;
	}
	 
	.spinner .bounce1 {
	  -webkit-animation-delay: -0.32s;
	  animation-delay: -0.32s;
	}
	 
	.spinner .bounce2 {
	  -webkit-animation-delay: -0.16s;
	  animation-delay: -0.16s;
	}
	 
	@-webkit-keyframes bouncedelay {
	  0%, 80%, 100% { -webkit-transform: scale(0.0) }
	  40% { -webkit-transform: scale(1.0) }
	}
	 
	@keyframes bouncedelay {
	  0%, 80%, 100% {
	    transform: scale(0.0);
	    -webkit-transform: scale(0.0);
	  } 40% {
	    transform: scale(1.0);
	    -webkit-transform: scale(1.0);
	  }
	}
</style>
